The videos directory doesn't necessarily have to exist, users are free to
delete it. Right now we don't handle this case and screencasting fails.
Let's handle it and fall back to the users home directory instead when
xdg-videos doesn't exist.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2594>
if (GLib.path_is_absolute(filename))
return filename;
- let videoDir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_VIDEOS);
+ const videoDir =
+ GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_VIDEOS) ||
+ GLib.get_home_dir();
+
return GLib.build_filenamev([videoDir, filename]);
}